<article class="cl pd-20">
    <form action="createMeeting" method="post" class="form form-horizontal" id="form">
        <input type="hidden" class="input-text" value="{$data['id']}" placeholder="" name="id">
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-2"><span class="c-red"></span>会议名称</label>
            <div class="formControls col-xs-10 col-sm-10">
                <input type="text" class="input-text" value="{$data['meeting_name']}" placeholder="" name="meeting_name">
                <span></span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">会议主图</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="uploader-thum-container">
                    <div id="upload-list" class="uploader-list">
                        {if $data['headimage']}
                        <img style="max-width:300px;" src="<?=$data['headimage']?>"/>
                        {/if}
                    </div>
                    <input type="hidden" id="upload-input" name="headimage" value="<?php echo $data['headimage']?>" class="input-text">
                    <div id="filePicker">
                        <a id="upload" class="btn btn-primary radius">选择图片</a>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-2"><span class="c-red"></span>会议简介</label>
            <div class="formControls col-xs-10 col-sm-10">
                <input type="text" class="input-text" value="{$data['desc']}" placeholder="" name="desc">
                <span></span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-2"><span class="c-red"></span>开始时间</label>
            <div class="formControls col-xs-10 col-sm-10">
                <input type="text" autocomplete="off" class="input-text" id="start_time" value="{$data['start_time']}" placeholder="" name="start_time">
                <span></span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-2"><span class="c-red"></span>结束时间</label>
            <div class="formControls col-xs-10 col-sm-10">
                <input type="text" autocomplete="off" class="input-text" id="end_time" value="{$data['end_time']}" placeholder="" name="end_time">
                <span></span>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-10 col-sm-10 col-xs-offset-2 col-sm-offset-2">
                <a onclick="PageFormSubmit()" class="btn btn-primary radius" >&nbsp;&nbsp;提交&nbsp;&nbsp;</a>
            </div>
        </div>
    </form>
</article>
<script>
    laydate.render({
        elem: '#start_time',
        type: 'datetime'
    });
    laydate.render({
        elem: '#end_time',
        type: 'datetime'
    });
</script>
<script src="https://cdn.bootcss.com/plupload/3.1.0/plupload.js"></script>
<script type="text/javascript">
MXI_DEBUG = false;
var ids = new Array("upload");
$.each(ids,function(i,n){
    var self = this.toString();
    var uploader = new plupload.Uploader({
        browse_button: self, // this can be an id of a DOM element or the DOM element itself
        url: '/admin/config/uploadpic',
        multi_selection: false,
        filters: {
            mime_types : [
                { title : "Image files", extensions : "jpg,gif,png,jpeg" }
            ]
        },
        init: {
            FilesAdded: function (e) {
                layer.load();//正在加载
                uploader.start();
            },
            FileUploaded: function (up, file, info) {
                layer.closeAll('loading');//关闭正在加载
                var res = JSON.parse(info.response);
                if(res.ret==0) {
                    var img = "<img style='max-width:300px;' src='"+res.data+"'/>";
                    $('#'+self+'-list').html(img);
                    $('#'+self+'-input').val(res.data);
                }
            }
        }
    });
uploader.init();
});
</script>
